home *** CD-ROM | disk | FTP | other *** search
- PAGE 63,132
- TITLE Program MC68HC705C8
- SUBTTL By Gil Shultz
-
- COMMENT |
-
- This is included so you can customize PROG7.COM to process about any of the
- motorola HC05 microprocessors that will support the serial boot SCI mode. A
- word of caution, PROG7 DOES NOT check the validity of the data in the over
- lay, and will use whatever you enter. This could lead to crashing your system
- or worse. Prog7 has a max capacity of 12K of memory for the chips. Making
- this overlay tell it that there is more will wipe out it's internal stack and
- cause it to go into never never land. Currently PROG7 uses memory up to
- SEGMENT:0E800 for itself and buffers. The stack starts at SEGMENT:FFFF,
- therefore you need 64K of ram free to be able to run this program.
-
- |
- ;********************************
- ;* *
- ;* Enable cref and list *
- ;* *
- ;* Define system equates *
- ;* *
- ;********************************
-
- ; .CREF ; Enable cross referencing
- .XCREF ; Disable cross referencing
- .LIST ; Enable list file
- ; .XLIST ; Disable list file
-
- ;********************************************************
- ;* *
- ;* *
- ;* Use the Microsoft macro assembler 5.1 *
- ;* *
- ;* To Create: MASM PROG7OVL *
- ;* LINK PROG7OVL *
- ;* EXE2BIN PROG7OVL PROG7OVL.COM *
- ;* Rename PROG&OVL.COM to PROG7.OVL *
- ;* *
- ;* Program '7' allows programing MC68HC705C8 *
- ;* *
- ;* *
- ;********************************************************
-
- CSEG SEGMENT PARA PUBLIC 'CODE' ; Start CODE segment
- ASSUME CS:CSEG, DS:CSEG, ES:CSEG, SS:CSEG
- PAGE
- ;************************************************
- ;* *
- ;* Character equates *
- ;* *
- ;************************************************
-
- CR EQU 0DH ; carriage return character
- LF EQU 0AH ; line feed character
-
- BAUD150 EQU 300H ; 768 Clock division ratio
- BAUD300 EQU 180H ; 384 Clock division ratio
- BAUD600 EQU 0C0H ; 192 Clock division ratio
- BAUD1200 EQU 60H ; 96 Clock division ratio
- BAUD2400 EQU 30H ; 48 Clock division ratio
- BAUD4800 EQU 18H ; 24 Clock division ratio
- BAUD9600 EQU 0CH ; 12 Clock division ratio
- BAUD19200 EQU 6H ; 6 Clock division ratio
- BAUD38K EQU 3H ; 3 Clock division ratio
- BAUD56K EQU 2H ; 2 Clock division ratio
- BAUD115K EQU 1 ; 1 Clock division ratio
- PAGE
- ;****************************************************************
- ;* *
- ;* This is a little tricky but the assembler is forced to *
- ;* process this in the first pass only, and increments it *
- ;* after each programing module is processed with this *
- ;* statement: (RCOUNT=RCOUNT+1). This then forces the *
- ;* assembler to count modules for us, that way we won't *
- ;* forget to update the count. Prog7 uses this number to *
- ;* determine if the chip selected (S command) is valid. *
- ;* *
- ;****************************************************************
-
- IF1
- RCOUNT = 0 ; set counter
- ENDIF
-
- ;****************************************************************
- ;* *
- ;* Use a little care here, when a .COM file is generated *
- ;* for the PC, it is assumed that the PSP will reside in *
- ;* the first 256 bytes of code, and the program will *
- ;* actually start after that. Therefore in a .COM file, *
- ;* the data byte at location 100 will actually be the *
- ;* first byte in the file. We are then putting 256 dummy *
- ;* bytes (zero, but doesn't matter what the data is) at *
- ;* the beginning of the overlay file. The reason for this *
- ;* is to allow you to assemble a variation of this file *
- ;* the AS05 ASSEMBLER, and then load it with PROG7, and *
- ;* then, by doing a BINARY save you can create your own *
- ;* customized overlay file. *
- ;* *
- ;****************************************************************
-
- ORG 100H ; Set so conversion to com will work
- MAIN PROC NEAR ; Define procedure, needed for MASM
- DB 256 DUP (0) ; fill first block so that the
- ; data starts 100H bytes into the file
- DW (ENDMSG-OVERLY) ; Tell overlay loader how long message
- ; section of overlay is any length is ok.
- DW RCOUNT ; This has the number of overlays in
- ; this module. Caution this is calculated
- ; by the assembler
- PAGE
- ;****************************************************************
- ;* *
- ;* If you want this to work with MASM no monkey with *
- ;* the ORG, DB statements above. the DW statement is used *
- ;* by the overlay loader to determine how long the first *
- ;* record is. all additional records must be 512 bytes *
- ;* in length if the overlay is to work. Make them of *
- ;* another length if you like but don't ask me for help. *
- ;* *
- ;* *
- ;* This is the menu that will be displayed when the chip *
- ;* command is issued. Doesn't matter what is in it, but *
- ;* prog7.COM will assume that after displaying the whole *
- ;* message and that additional records are 512 bytes in *
- ;* length. The location of data in these records is fixed *
- ;* and cannot be changed. This is designed so you can *
- ;* also generate your own custom overlay at will and use *
- ;* the ASM05 assembler or MASM to generate the overlay. *
- ;* It is also designed that if you use ASM05, you can use *
- ;* PROG7.COM to convert it from "S1" records to a binary *
- ;* overlay with the load and save "B" command. When doing *
- ;* this be sure the program is set up for a "C8", to be *
- ;* sure that you have enough rom area to load the overlay *
- ;* into. You have 2 control characters that you can put *
- ;* into the message, they are a ^P CTRL-P for pause and a *
- ;* ^L CTRL-L to cause PROG7.COM to clear the screen. *
- ;* *
- ;* Enjoy - Gil Shultz Motorola *
- ;* *
- ;****************************************************************
-
- OVERLY: DB '(1) MC68HC705C8',CR,LF
- .XLIST ; Just to keep listing neet
- DB '(2) MC68HC805C4 - Note this is a Dummy entry',CR,LF
- DB '(3) MC68HC705B5 - Note this is a Dummy entry',CR,LF
- DB '(4) MC68HC805B6 - Note this is a Dummy entry',CR,LF,CR,LF
- DB 'Overlay by Gil Shultz 12/28/89',CR,LF,CR,LF,'$'
-
- DB 'This is a sample of the overlay. This first block CAN BE any length',CR,LF
- DB ' NOTE: the first four bytes are reserved for prog7.',CR,LF
- DB 'Note the ($) dollar character terminates the display, and data',CR,LF
- DB 'following that will not be displayed even though it is in',CR,LF
- DB 'the over lay file. The above message is copied as it is to',CR,LF
- DB 'the console device until a "$" is encountered. The rest of',CR,LF
- DB 'the data following is ignored. Absolute address in this overlay',CR,LF
- DB 'mean nothing to prog7, but record block sizes and data locations',CR,LF
- DB 'do. You can use any assembler that is convenient to add/modify',CR,LF
- DB 'this over lay. You can edit the text with a text editor and copy',CR,LF
- DB 'the tables to the end of it with copy and the /B option.',CR,LF
-
- ALIGN 256 ; Put on even page boundary to make checking easy
- ENDMSG: ; This is used to calculate
- ; message length for PROG7
- .LIST
- PAGE
- ;=======================[ Overlay Data Starts here ]========================
-
- ;*******************************************************
- ;* *
- ;*-----[ The following is for a MC68HC705C8 Chip ]-----*
- ;* *
- ;*******************************************************
-
- M1_: ; Reference label for block
- M1_TABSIZ: DB 1FH ; Length of memory map anded 0FF00H
- M1_DELCNT: DB 14 ; Delay for programing 1 SEC = 18.2
- ; This is wait time for pgmr to respond
- M1_NUMPAS: DB 2 ; number of passes needed to program EPROM
- M1_SWIDAT: DB 83H ; SWI instruction
- M1_ROMBLK: DB 0 ; rom blank character (when erased)
- M1_RAMBLK: DB 0 ; ram blank character (doesn't much matter)
- M1_BLINKS: DB 12 ; number of blink cycles for LED's
- M1_BAUD: DW BAUD4800 ; Baud to communicate with programmer
- M1_VECTOR: DW 1FF4H,1FFFH ; Vector locations in the Chip
- M1_ROMSIZ: DB ((M1_RAMSIZ-M1_ROMSIZ)-1)/4 ; number of entries in rom table
- DW 20H,04FH ; start rom locations
- DW 100H,1EFFH ; end rom locations
- M1_RAMSIZ: DB ((M1_CHPNAM-M1_RAMSIZ)-1)/4 ; Number of entries in RAM table
- DW 50H,0FFH ; First location is loader address
- ; The programing code is loaded here
- M1_CHPNAM: DB 'MC68HC705C8$' ; Name of Chip
-
- ORG (M1_+256)
- .XLIST ; Not needed
- M1_LOADER: ; Include processor dependent code
- INCLUDE PROG7C8.INC ; the processor dependent code
- .LIST ; display what we have
- DB ((M1_+512) - $) ; Filler for now
- ORG M1_ + 512
- IF1
- RCOUNT = (RCOUNT+1)
- ENDIF
- PAGE
- ;=======================[ Overlay Data Starts here ]========================
-
- ;********************************************************
- ;* *
- ;*-----[ The following is for a MC68HC805C4 Chip ]------*
- ;* *
- ;********************************************************
-
- M2_:
- M2_TABSIZ: DB 0FH ; Length of memory map
- M2_DELCNT: DB 14 ; Delay for programing 1 SEC = 18.2
- ; This is wait time for pgmr to respond
- M2_NUMPAS: DB 1 ; number of passes needed to program EPROM
- M2_SWIDAT: DB 83H ; SWI instruction
- M2_ROMBLK: DB 0FFH ; rom blank character
- M2_RAMBLK: DB 0 ; ram blank character
- M2_BLINKS: DB 4 ; number of blinks for LED's
- M2_BAUD: DW BAUD4800 ; Baud to communicate with programmer
- M2_VECTOR: DW 1FF4H,1FFFH ; Vector locations
- M2_ROMSIZ: DB ((M2_RAMSIZ-M2_ROMSIZ)-1)/4 ; number of entries in rom table
- DW 20H,04FH ; start rom locations
- DW 100H,0EFFH ; end rom locations
- M2_RAMSIZ: DB ((M2_CHPNAM-M2_RAMSIZ)-1)/4 ; Number of entries in RAM table
- DW 50H,0FFH ; First location is loader address
-
- M2_CHPNAM: DB 'MC68HC805C4 This is a Dummy$' ; Name of Chip
-
- ORG (M2_+256)
- .XLIST
- M2_LOADER: ; Include processor dependent code
- INCLUDE PROG7C8.INC ; the processor dependent code
- .LIST
- DB ((M2_+512) - $) ; Filler for now
- ORG M2_ + 512
- IF1
- RCOUNT = (RCOUNT+1)
- ENDIF
- PAGE
- ;=======================[ Overlay Data Starts here ]========================
-
- ;********************************************************
- ;* *
- ;*-----[ The following is for a MC68HC805XX Chip ]------*
- ;* *
- ;********************************************************
-
- M3_:
- M3_TABSIZ: DB 2FH ; Length of memory map
- M3_DELCNT: DB 10 ; Delay for programing 1 SEC = 18.2
- ; This is wait time for pgmr to respond
- M3_NUMPAS: DB 1 ; number of passes needed to program EPROM
- M3_SWIDAT: DB 83H ; SWI instruction
- M3_ROMBLK: DB 0 ; rom blank character
- M3_RAMBLK: DB 0 ; ram blank character
- M3_BLINKS: DB 9 ; number of blinks for LED's
- M3_BAUD: DW BAUD9600 ; Baud to communicate with programmer
- M3_VECTOR: DW 1FF4H,1FFFH ; Vector locations
- M3_ROMSIZ: DB ((M3_RAMSIZ-M3_ROMSIZ)-1)/4 ; number of entries in rom table
- DW 20H,04FH ; start rom locations
- DW 100H,1EFFH ; end rom locations
- DW 2000H,2FFFH ; add an additional rom block
- M3_RAMSIZ: DB ((M3_CHPNAM-M3_RAMSIZ)-1)/4 ; Number of entries in RAM table
- DW 50H,0FFH ; First location is loader address
- DW 0,2FH ; add some locations
- DW 40,9FH
- M3_CHPNAM: DB 'MC68HC805XX This is a Dummy$' ; Name of Chip
-
- ORG (M3_+256)
- .XLIST
- M3_LOADER: ; Include processor dependent code
- INCLUDE PROG7C8.INC ; the processor dependent code
- .LIST
- DB ((M3_+512) - $) ; Filler for now
- ORG M3_ + 512
- IF1
- RCOUNT = (RCOUNT+1)
- ENDIF
-
- PAGE
- ;=======================[ Overlay Data Starts here ]========================
-
- ;********************************************************
- ;* *
- ;*-----[ The following is for a MC68HC805C8 Chip ]------*
- ;* *
- ;********************************************************
-
- M4_: ; Reference label for block
- M4_TABSIZ: DB 1FH ; Length of memory map anded 0FF00H
- M4_DELCNT: DB 14 ; Delay for programing 1 SEC = 18.2
- ; This is wait time for pgmr to respond
- M4_NUMPAS: DB 1 ; number of passes needed to program EPROM
- M4_SWIDAT: DB 83H ; SWI instruction
- M4_ROMBLK: DB 0FFH ; rom blank character (when erased)
- M4_RAMBLK: DB 0 ; ram blank character (doesn't much matter)
- M4_BLINKS: DB 10 ; number of blink cycles for LED's
- M4_BAUD: DW BAUD9600 ; Baud to communicate with programmer
- M4_VECTOR: DW 1FF0H,1FFFH ; Vector locations in the Chip
- M4_ROMSIZ: DB ((M4_RAMSIZ-M4_ROMSIZ)-1)/4 ; number of entries in rom table
- DW 20H,04FH ; start rom locations
- DW 101H,1FFH ; end rom locations
- DW 800H,1EFFH
- M4_RAMSIZ: DB ((M4_CHPNAM-M4_RAMSIZ)-1)/4 ; Number of entries in RAM table
- DW 50H,0FFH ; First location is loader address
- ; The programing code is loaded here
- M4_CHPNAM: DB 'MC68HC805B6$' ; Name of Chip
-
- ORG (M4_+256)
- .XLIST ; Not needed
- M4_LOADER: ; Include processor dependent code
- INCLUDE PROG7C8.INC ; the processor dependent code
- .LIST ; display what we have
- DB ((M4_+512) - $) ; Filler for now
- ORG M4_ + 512
- IF1
- RCOUNT = (RCOUNT+1)
- ENDIF
-
- ;=======================[ Overlay Data Starts here ]========================
-
- ;********************************************************
- ;* *
- ;*---------[ The following is a dummy record ]----------*
- ;* *
- ;********************************************************
-
- ;<<<<<<<<<<<<---------------->>>>>>>>>>>>>> Insert additional overlays here
-
- M5_:
- DB 0,1,2,3,4 ; just for test
-
- MAIN ENDP
- CSEG ENDS
- END MAIN
-
- USE THIS AS A SAMPLE FOR ADDING ADDITIONAL CHIPS TO THE OVERLAY, JUST CHANGE
- THE M0_ TO WHATEVER YOU WANT, AND IT SHOULD WORK PERFECTLY. YOU ALSO NEED TO
- EDIT THE ACTUAL DATA IN THE TABLES AND CORRECT IT TO WHATEVER YOU WANT.
-
- PAGE
- ;=======================[ Overlay Data Starts here ]========================
-
- ;********************************************************
- ;* *
- ;*-----[ The following is for a MC68HC805C8 Chip ]------*
- ;* *
- ;********************************************************
-
- M0_: ; Reference label for block
- M0_TABSIZ: DB 1FH ; Length of memory map anded 0FF00H
- M0_DELCNT: DB 14 ; Delay for programing 1 SEC = 18.2
- ; This is wait time for pgmr to respond
- M0_NUMPAS: DB 2 ; number of passes needed to program EPROM
- M0_SWIDAT: DB 83H ; SWI instruction
- M0_ROMBLK: DB 0 ; rom blank character (when erased)
- M0_RAMBLK: DB 0 ; ram blank character (doesn't much matter)
- M0_BLINKS: DB 12 ; number of blink cycles for LED's
- M0_BAUD: DW BAUD4800 ; Baud to communicate with programmer
- M0_VECTOR: DW 1FF4H,1FFFH ; Vector locations in the Chip
- M0_ROMSIZ: DB ((M0_RAMSIZ-M0_ROMSIZ)-1)/4 ; number of entries in rom table
- DW 20H,04FH ; start rom locations
- DW 100H,1EFFH ; end rom locations
- M0_RAMSIZ: DB ((M0_CHPNAM-M0_RAMSIZ)-1)/4 ; Number of entries in RAM table
- DW 50H,0FFH ; First location is loader address
- ; The programing code is loaded here
- M0_CHPNAM: DB 'MC68HC805C8$' ; Name of Chip
-
- ORG (M0_+256)
- .XLIST ; Not needed
- M0_LOADER: ; Include processor dependent code
- INCLUDE PROG7C8.INC ; the processor dependent code
- .LIST ; display what we have
- DB ((M0_+512) - $) ; Filler for now
- ORG M0_ + 512
- IF1
- RCOUNT = (RCOUNT+1)
- ENDIF
-